const puppeteer = require('puppeteer');
const path = require('path');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto(`file://${path.join(__dirname, 'public/sample-pdfs/contract.html')}`, { waitUntil: 'networkidle0' });
  await page.pdf({ path: path.join(__dirname, 'public/sample-pdfs/contract.pdf'), format: 'a4' });

  await browser.close();
})();